class _const:
    class ConstError(TypeError):
        pass

    class ConstCaseError(ConstError):
        pass

    def __setattr__(self, name, value):
        if name in self.__dict__:
            raise self.ConstError("can't change const %s" % name)
        if not name.isupper():
            raise self.ConstCaseError('const name "%s" is not all uppercase' % name)
        self.__dict__[name] = value


# 任务状态： 0-任务加载中/1-运行中/2-手动暂停/3-执行成功/4-执行异常失败
const = _const()
const.TASK_STATUS_LOADING = 0
const.TASK_STATUS_RUNNING = 1
const.TASK_STATUS_STOP = 2
const.TASK_STATUS_DONE = 3
const.TASK_STATUS_EXCEPT = 4
